﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using NarutoClient.Pages;
using System.Net;
using System.Net.Sockets;
using System.Threading;

namespace NarutoClient
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        #region Fields

        protected Socket socket;
        protected ClientCommunication communication;
        protected Thread receiveThread;
        protected string login;
        protected GamedataLibrary.Characters.Character myCharacter;
        protected GamedataLibrary.CharactersID myCharacterID;

        protected BattlePage battlePage;

        #endregion // Fields

        #region Properties

        public Socket Socket { get { return socket; } set { socket = value; } }

        /// <summary>
        /// Komunikace mezi klientem a serverem.
        /// </summary>
        public ClientCommunication Communication { get { return communication; } set { communication = value; } }
        
        /// <summary>
        /// Reference na vlakno pro prijimani zprav.
        /// </summary>
        public Thread ReceiveThread { get { return receiveThread; } set { receiveThread = value; } }
        
        /// <summary>
        /// Login hrace.
        /// </summary>
        public string Login { get { return login; } set { login = value; } }
        
        /// <summary>
        /// Reference na vybranou postavu.
        /// </summary>
        public GamedataLibrary.Characters.Character MyCharacter { get { return myCharacter; } set { myCharacter = value; } }

        /// <summary>
        /// ID me zvolene postavy.
        /// </summary>
        public GamedataLibrary.CharactersID MyCharacterID { get { return myCharacterID; } set { myCharacterID = value; } }

        public BattlePage BattlePage { get { return battlePage; } set { battlePage = value; } }

        #endregion // Properties

        
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ContentControl.Content = new LoginPage(this);
        }

    }
}
